<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker,utils,yongxin,autocomplete"></t:base>

<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">

  <t:datagrid name="processReportList_${process}" title="工序汇报" actionUrl="processReport10Controller.do?datagrid"
              queryParams="{process:'${process}'}" idField="id" fit="true" queryMode="group" rowStyler="setMyColor">

   <t:dgCol title="编号" field="id" hidden="true" ></t:dgCol>
   <t:dgCol title="状态" field="fstate" dictionary="hbstate" style="setColor()" query="true" ></t:dgCol>
   <t:dgCol title="本厂批号" field="fbcph" query="true"  autocomplete="true"></t:dgCol>
   <t:dgCol title="物料名称"  field="fwlname" ></t:dgCol>
   <t:dgCol title="生产车间" field="fworkshop"  dictionary="workshop"></t:dgCol>
   <t:dgCol title="机组" field="fmatchinegroup" ></t:dgCol>
   <t:dgCol title="班组" field="fworkgroup" dictionary="team"></t:dgCol>
   <t:dgCol title="投入厚度" field="ftrhd" ></t:dgCol>  
   <t:dgCol title="投入宽度" field="ftrkd" ></t:dgCol>
   <t:dgCol title="投入重量" field="ftrzl" ></t:dgCol>
   <t:dgCol title="产出厚度" field="fcchd" ></t:dgCol>
   <t:dgCol title="产出宽度" field="fcckd" ></t:dgCol>
   <t:dgCol title="产出重量" field="fbfzl" hidden="false"></t:dgCol>
   <t:dgCol title="剩余重量" field="fcczl" ></t:dgCol>
   <t:dgCol title="成材率" field="frate" hidden="false"></t:dgCol>
   <t:dgCol title="质量情况" field="fnote" ></t:dgCol>
   <t:dgCol title="投料日期"  field="createDate"  formatter="yyyy-MM-dd hh:mm"></t:dgCol>
   <t:dgCol title="制单"    field="createBy" hidden="false"></t:dgCol>
   <t:dgCol title="汇报人"    field="updateBy" ></t:dgCol>
   <t:dgCol title="汇报日期"  field="updateDate"  formatter="yyyy-MM-dd"  query="true" queryMode="group"></t:dgCol>
   
   
   <t:dgCol title="当前工序" field="cprocess"  dictionary="ccgx"></t:dgCol>
   <t:dgCol title="下一工序" field="nprocess"  dictionary="ccgx"></t:dgCol>
   
   <t:dgToolBar title="工序汇报" icon="icon-edit" url="processReport10Controller.do?addorupdate" funname="update_check" operationCode="processReport10"></t:dgToolBar>
   <t:dgToolBar title="反汇报" icon="icon-undo"     url="processReport10Controller.do?returnReport" funname="returnReport10" operationCode="returnReport10"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="processReport10Controller.do?addorupdate" funname="detail"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
 
 
 <script>
 	function setMyColor(index,row){
 	 var value=row.fstate;
 		if(value==0){
 			return "color:blue;";
 		}
 		if(value==1){
 			return "color:red;";
 		}
 		if(value==2){
 			return "color:green;";
 		}
 		if(value==3){
 			return "color:orange;";
 		}
 		return "";
 	}
 	
	function update_check(title,url, id,width,height) {
 	
 		var rowsData = $('#'+id).datagrid('getSelections');
		if (!rowsData || rowsData.length==0) {
			tip('请选择编辑项目');
			return;
		}
		if (rowsData.length>1) {
			tip('请选择一条记录再编辑');
			return;
		}
		
		var fstate=rowsData[0].fstate;
		
		if(fstate!="0" && fstate!="1" && fstate!="6"){
			tip('该记录已汇报');
			return;
		}
		
		update(title,url, id,width,height);
	}
	
		$(document).ready(function(){
		$("input[name='updateDate_begin']").attr("class","easyui-datebox");
		$("input[name='updateDate_end']").attr("class","easyui-datebox");
	});
 </script>